<?php
class Rzd_Filter_DeleteEmptyValuesRows implements Zend_Filter_Interface {

    public function filter($values)
    {
      if(count($values)) {
            foreach($values['data'] as $index => $rowValues) {
                $filteredValues = array_filter($rowValues);
                if(!count($filteredValues) || (count($filteredValues) == 1) && isset($filteredValues['id'])) {
                    unset($values['data'][$index]);
                }
            }
        }
        return $values;
    }
}
